package com.jeecms.cms.entity.assist.base;

import com.jeecms.cms.entity.assist.Branch;
import com.jeecms.cms.entity.assist.CmsEnterprise;

import java.io.Serializable;
import java.util.Set;

/**
 * Created by hashan on 2018-02-03.
 * table="jc_enterprise"
 */
public abstract class BaseCmsEnterprise implements Serializable {

    public static String REF = "CmsUser";

    protected void initialize() {
    }

    protected BaseCmsEnterprise() {
        initialize();
    }

    public BaseCmsEnterprise(Integer id) {
        this.setId(id);
        initialize();
    }

    public BaseCmsEnterprise(Integer id, String name, Set<Branch> branchs, String invitationCode, Integer invitationCount, String legalPerson, String contacts, String companyEmail, String companyId, String postCode, String companyAddress, String remarks) {
        this.setId(id);
        this.setName(name);
        this.setBranchs(branchs);
        this.setInvitationCode(invitationCode);
        this.setInvitationCount(invitationCount);
        this.setLegalPerson(legalPerson);
        this.setContacts(contacts);
        this.setCompanyEmail(companyEmail);
        this.setCompanyId(companyId);
        this.setPostCode(postCode);
        this.setCompanyAddress(companyAddress);
        this.setRemarks(remarks);
        initialize();
    }

    private int hashCode = Integer.MIN_VALUE;

    // primary key
    private java.lang.Integer id;

    // fields
    private java.lang.String name;           //企业名称
    private java.lang.String industry;
    private java.lang.String invitationCode; //邀请码
    private java.lang.Integer invitationCount;//邀请码次数
    private java.lang.String legalPerson;    //企业法人
    private java.lang.String contacts;          //联系电话
    private java.lang.String companyEmail;   //企业邮箱
    private java.lang.String companyId;      //企业三证合一码
    private java.lang.String postCode;       //企业邮编
    private java.lang.String companyAddress; //企业地址
    private java.lang.String remarks;        //备注

    private Set<Branch> branchs;       //企业分类

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIndustry() {
        return industry;
    }

    public void setIndustry(String industry) {
        this.industry = industry;
    }

    public Set<Branch> getBranchs() {
        return branchs;
    }

    public void setBranchs(Set<Branch> branchs) {
        this.branchs = branchs;
    }

    public String getInvitationCode() {
        return invitationCode;
    }

    public void setInvitationCode(String invitationCode) {
        this.invitationCode = invitationCode;
    }

    public Integer getInvitationCount() {
        return invitationCount;
    }

    public void setInvitationCount(Integer invitationCount) {
        this.invitationCount = invitationCount;
    }

    public String getLegalPerson() {
        return legalPerson;
    }

    public void setLegalPerson(String legalPerson) {
        this.legalPerson = legalPerson;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getCompanyEmail() {
        return companyEmail;
    }

    public void setCompanyEmail(String companyEmail) {
        this.companyEmail = companyEmail;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getPostCode() {
        return postCode;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    public String getCompanyAddress() {
        return companyAddress;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public boolean equals (Object obj) {
        if (null == obj) return false;
        if (!(obj instanceof CmsEnterprise)) return false;
        else {
            CmsEnterprise cmsEnterprise = (CmsEnterprise) obj;
            if (null == this.getId() || null == cmsEnterprise.getId()) return false;
            else return (this.getId().equals(cmsEnterprise.getId()));
        }
    }

    public int hashCode () {
        if (Integer.MIN_VALUE == this.hashCode) {
            if (null == this.getId()) return super.hashCode();
            else {
                String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
                this.hashCode = hashStr.hashCode();
            }
        }
        return this.hashCode;
    }

    public String toString () {
        return super.toString();
    }
}
